package org.argeproje.resim.ui.component.histogram;
import org.argeproje.resim.proc.histogram.LocalHistogramEqualizePR;
import org.argeproje.resim.property.IntegerPRP;
import org.argeproje.resim.ui.model.ComponentItem;
public class LocalHistogramEqualizeCI extends ComponentItem {
	private static final long serialVersionUID = 1;
	private static final String LOCAL_WIDTH_PROP = "LocalHistogramEqualizeCI._localWidth";	
	private int _localWidth;
	private static final String LOCAL_HEIGHT_PROP = "LocalHistogramEqualizeCI._localHeight";	
	private int _localHeight;
	public LocalHistogramEqualizeCI()
	{		
		super();
		_name = "Local\nHistogram\nEqualize";
		_description = "";
		initProc();
	}
	public void setLocalWidth(int value)
	{
		_localWidth = value;
	}
	public int getLocalWidth()
	{
		return _localWidth;
	}	
	public void setLocalHeight(int value)
	{
		_localHeight = value;
	}
	public int getLocalHeight()
	{
		return _localHeight;
	}	
	protected void initDescriptorList()
	{
		super.initDescriptorList();
		registerProperty(new IntegerPRP(this,
				LOCAL_WIDTH_PROP, "Local Width", "getLocalWidth", "setLocalWidth"));
		registerProperty(new IntegerPRP(this,
				LOCAL_HEIGHT_PROP, "Local Height", "getLocalHeight", "setLocalHeight"));
	}

	@Override
	public Class<LocalHistogramEqualizeCI> getComponentClass() {
		// TODO Auto-generated method stub
		return LocalHistogramEqualizeCI.class;
	}

	public void initProc() {
		if(_processor == null)
		{
			_processor = new LocalHistogramEqualizePR();			
		}
		_localWidth = ((LocalHistogramEqualizePR)_processor).getParamLocalWidth();
		_localHeight = ((LocalHistogramEqualizePR)_processor).getParamLocalHeight();
	}
	
	public void updateProc() {
		if(_processor == null)
		{
			_processor = new LocalHistogramEqualizePR();			
		}
		((LocalHistogramEqualizePR)_processor).setParameters(_localWidth, _localHeight);
	}
}